#include<stdio.h>
int main()
{
    //freopen("in.txt","r",stdin);
    char s[14];
    int k[9];
    scanf("%s",s);
    int j = 0;
    for(int i = 0;i < 11;i++)
    {
        if('0' <= s[i] && s[i] <= '9')
        {
            k[j++] = s[i] - '0';
        }
    }
    int m = 0;
    for(int i = 1; i <= 9;i++)
    {
        m+=k[i-1]*i;
    }
    m = m % 11;
    if(m == s[12] -'0' || (m==10 && s[12] == 'X')) printf("Right");
    else 
    {
        s[12] = '\0';
        printf("%s",s);
        if(m==10) printf("X");
        else printf("%d",m);
    }
    return 0;
}